import { AxiosPromise } from 'axios';
import request from '@/utils/request';

export function optionList(query: any): AxiosPromise<any[]> {
  return request({
    url: '/wiki/option/list',
    method: 'get',
    params: query
  });
}

export function optionDetail(id: string): AxiosPromise<any> {
  return request({
    url: '/wiki/option/' + id,
    method: 'get'
  });
}

export function saveOption(data: any): AxiosPromise<any> {
  return request({
    url: '/wiki/option',
    method: 'post',
    data
  });
}

export function updateOption(data: any): AxiosPromise<any> {
  return request({
    url: '/wiki/option',
    method: 'put',
    data
  });
}

export function deleteOption(id: string): AxiosPromise<any> {
  return request({
    url: '/wiki/option/' + id,
    method: 'delete'
  });
}
